From 98f7f2a2cfa6e28bdc5e73de1bc5affac83c72b6 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sat, 3 May 2025 14:43:28 +0200 Subject: [PATCH] luci-app-adblock: sync with update 4.4.1-2 Small fixes, a uci-defaults script and wording improvements. Signed-off-by: Dirk Brenken --- .../resources/view/adblock/overview.js | 21 ++++++++++--------- .../95-luci-app-adblock-housekeeping | 4 ++++ 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100755 applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js index a17a56f92c..6d612fc452 100644 --- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js +++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js @@ -19,7 +19,7 @@ function handleAction(ev) { } if (ev === 'restart' || ev === 'reload') { let map = document.querySelector('.cbi-map'); - dom.callClassMethod(map, 'save') + return dom.callClassMethod(map, 'save') .then(L.bind(ui.changes.apply, ui.changes)) .then(function () { return fs.exec_direct('/etc/init.d/adblock', [ev]); @@ -211,11 +211,16 @@ return view.extend({ o = s.taboption('general', form.Flag, 'adb_enabled', _('Enabled'), _('Enable the adblock service.')); o.rmempty = false; - o = s.taboption('general', widgets.NetworkSelect, 'adb_trigger', _('Startup Trigger Interface'), _('List of available network interfaces to trigger the adblock start. \ - Choose \'unspecified\' to use a classic startup timeout instead of a network trigger.')); + o = s.taboption('general', widgets.NetworkSelect, 'adb_trigger', _('Startup Trigger Interface'), _('List of available network interfaces to trigger the adblock start.')); + o.multiple = true; o.nocreate = true; o.rmempty = true; + o = s.taboption('general', form.Value, 'adb_triggerdelay', _('Trigger Delay'), _('Additional trigger delay in seconds before adblock processing begins.')); + o.placeholder = '5'; + o.datatype = 'range(1,300)'; + o.rmempty = true; + o = s.taboption('general', form.Flag, 'adb_dnsforce', _('Force Local DNS'), _('Redirect all DNS queries from specified zones to the local DNS resolver, applies to UDP and TCP protocol.')); o.rmempty = false; @@ -281,11 +286,6 @@ return view.extend({ o.enabled = '10'; o.rmempty = true; - o = s.taboption('additional', form.Value, 'adb_triggerdelay', _('Trigger Delay'), _('Additional trigger delay in seconds before adblock processing begins.')); - o.placeholder = '2'; - o.datatype = 'range(1,300)'; - o.rmempty = true; - o = s.taboption('additional', form.Value, 'adb_tmpbase', _('Base Temp Directory'), _('Base temp directory for all adblock related runtime operations, \ e.g. downloading, sorting, merging etc.')); o.placeholder = '/tmp'; @@ -363,11 +363,12 @@ return view.extend({ o.optional = true; o.rmempty = true; - o = s.taboption('adv_dns', form.Flag, 'adb_jail', _('Additional Jail Blocklist'), _('Builds an additional DNS blocklist to block access to all domains except those listed in the whitelist. \ + o = s.taboption('adv_dns', form.Flag, 'adb_jail', _('Jail Blocklist'), _('Builds an additional restrictive DNS blocklist to block access to all domains except those listed in the allowlist. \ You can use this restrictive blocklist e.g. for guest wifi or kidsafe configurations.')); o.rmempty = true; - o = s.taboption('adv_dns', form.Value, 'adb_jaildir', _('Jail Directory'), _('Target directory for the generated jail blocklist.')); + o = s.taboption('adv_dns', form.Value, 'adb_jaildir', _('Jail Directory'), _('Target directory for the generated jail blocklist. \ + If this directory points to your DNS directory, the jail blocklist replaces your default blocklist.')); o.depends('adb_jail', '1'); o.placeholder = '/tmp'; o.rmempty = true; diff --git a/applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping b/applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping new file mode 100755 index 0000000000..e6e19f9f25 --- /dev/null +++ b/applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping @@ -0,0 +1,4 @@ +#!/bin/sh +rm -f /var/luci-indexcache.*.json +[ -x "/etc/init.d/rpcd" ] && /etc/init.d/rpcd reload +exit 0 -- 2.30.2